package com.biqee.dao.impl;

import com.biqee.dao.Hao123StyleItemDao;
import com.biqee.dao.base.BaseDAOImpl;
import com.biqee.model.db.Hao123StyleItem;

public class Hao123StyleItemDaoImpl extends BaseDAOImpl implements Hao123StyleItemDao {

	@Override
	public Hao123StyleItem read(Integer id) {
		return (Hao123StyleItem)getSqlMapClientTemplate().queryForObject(getRealSqlId("read"), id);
	}

	@Override
	public Integer create(Hao123StyleItem hao123StyleItem) {
		if(hao123StyleItem == null) {
			throw new RuntimeException("hao123StyleItem should not be null");
		}
		
		return (Integer)getSqlMapClientTemplate().insert(getRealSqlId("create"), hao123StyleItem);
	}

	@Override
	public Integer update(Hao123StyleItem hao123StyleItem) {
		if(hao123StyleItem == null) {
			throw new RuntimeException("hao123StyleItem should not be null");
		}
		
		return (Integer)getSqlMapClientTemplate().update(getRealSqlId("update"), hao123StyleItem);
	}

	@Override
	public Hao123StyleItem readByLoc(String loc) {
		return (Hao123StyleItem)getSqlMapClientTemplate().queryForObject(getRealSqlId("readByLoc"), loc);
	}

	
}
